<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">

    <title>{% block title %}Jupyter Notebook{% endblock %}</title>
    {% block favicon %}<link id="favicon" rel="shortcut icon" type="image/x-icon" href="{{static_url("base/images/favicon.ico") }}">{% endblock %}
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="stylesheet" href="{{static_url("components/jquery-ui/themes/smoothness/jquery-ui.min.css") }}" type="text/css" />
    <link rel="stylesheet" href="{{static_url("components/jquery-typeahead/dist/jquery.typeahead.min.css") }}" type="text/css" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    {% block stylesheet %}
    <link rel="stylesheet" href="{{ static_url("style/style.min.css") }}" type="text/css"/>
    {% endblock %}
    <link rel="stylesheet" href="{{ base_url }}custom/custom.css" type="text/css" />
    <script src="{{static_url("components/jquery/jquery.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- window.$ -->
    <script src="{{static_url("components/jquery-ui/ui/minified/jquery-ui.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- extends window.$ -->
    <script src="{{static_url("components/bootstrap/js/bootstrap.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- extends window.$ -->
    <script src="{{static_url("components/bootstrap-tour/build/js/bootstrap-tour.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- window.Tour -->
    <script src="{{static_url("components/jquery-typeahead/dist/jquery.typeahead.min.js") }}" type="text/javascript" charset="utf-8"></script> <!-- extends window.$ -->
    <script src="{{static_url("components/codemirror/lib/codemirror.js") }}" type="text/javascript" charset="utf-8"></script>
    <script src="{{static_url("components/codemirror/mode/meta.js") }}" type="text/javascript" charset="utf-8"></script>
    <script src="{{static_url("components/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script>
    <script>
      window['staticURL'] = "{{static_url("", include_version=False)}}";
      require.config({
          {% if version_hash %}
          urlArgs: "v={{version_hash}}",
          {% endif %}
          baseUrl: '{{static_url("", include_version=False)}}',
          paths: {
            'auth/js/main': 'auth/js/built/main.min',
            custom : '{{ base_url }}custom',
            nbextensions : '{{ base_url }}nbextensions',
            kernelspecs : '{{ base_url }}kernelspecs',
            underscore : 'components/underscore/underscore-min',
            backbone : 'components/backbone/backbone-min',
            codemirror: 'components/codemirror',

            // Define aliases for requirejs webpack imports
            notebook: 'built/index',

            // Anything jQuery related is loaded globally because it will
            // pollute the global object regardless and we want to avoid one
            // jQuery thinger from clompering another.
            jquery: 'base/js/jquery',
            bootstrap: 'base/js/jquery',
            bootstraptour: 'base/js/tour',
            'jquery-ui': 'base/js/jquery',
            jqueryui: 'base/js/jquery',
            typeahead: 'base/js/typeahead'
          },
          map: { // for backward compatibility
            "*": {
              "jqueryui": "jquery-ui",
            }
          },
          shim: {
            typeahead: {
              deps: ["jquery"],
              exports: "typeahead"
            },
            underscore: {
              exports: '_'
            },
            backbone: {
              deps: ["underscore", "jquery"],
              exports: "Backbone"
            },
            bootstrap: {
              deps: ["jquery"],
              exports: "bootstrap"
            },
            bootstraptour: {
              deps: ["bootstrap"],
              exports: "Tour"
            },
            "jquery-ui": {
              deps: ["jquery"],
              exports: "$"
            }
          },
          waitSeconds: 30,
          // TODO: Remove me in notebook version 6.0
          bundles: {
            'deprecated-imports': [
              'edit/js/savewidget',
              'edit/js/main',
              'edit/js/menubar',
              'edit/js/editor',
              'edit/js/notificationarea',
              'base/js/keyboard',
              'base/js/dialog',
              'base/js/notificationwidget',
              'base/js/namespace',
              'base/js/utils',
              'base/js/notificationarea',
              'base/js/events',
              'base/js/security',
              'base/js/page',
              'auth/js/main',
              'auth/js/logoutmain',
              'auth/js/loginmain',
              'auth/js/loginwidget',
              'terminal/js/main',
              'terminal/js/terminado',
              'notebook/js/toolbar',
              'notebook/js/savewidget',
              'notebook/js/main',
              'notebook/js/completer',
              'notebook/js/contexthint',
              'notebook/js/textcell',
              'notebook/js/cell',
              'notebook/js/tour',
              'notebook/js/menubar',
              'notebook/js/mathjaxutils',
              'notebook/js/codecell',
              'notebook/js/codemirror-ipython',
              'notebook/js/kernelselector',
              'notebook/js/codemirror-ipythongfm',
              'notebook/js/celltoolbarpresets/example',
              'notebook/js/celltoolbarpresets/default',
              'notebook/js/celltoolbarpresets/slideshow',
              'notebook/js/celltoolbarpresets/rawcell',
              'notebook/js/tooltip',
              'notebook/js/maintoolbar',
              'notebook/js/about',
              'notebook/js/notificationarea',
              'notebook/js/quickhelp',
              'notebook/js/actions',
              'notebook/js/pager',
              'notebook/js/searchandreplace',
              'notebook/js/keyboardmanager',
              'notebook/js/notebook',
              'notebook/js/scrollmanager',
              'notebook/js/outputarea',
              'notebook/js/celltoolbar',
              'notebook/js/commandpalette',
              'tree/js/sessionlist',
              'tree/js/main',
              'tree/js/kernellist',
              'tree/js/newnotebook',
              'tree/js/terminallist',
              'tree/js/notebooklist',
              'services/sessions/session',
              'services/contents',
              'services/kernels/serialize',
              'services/kernels/comm',
              'services/kernels/kernel',
              'services/config'
            ]
          }
      });

      require.config({
          map: {
              '*':{
                'contents': '{{ contents_js_source }}',
              }
          },
      });

      define("bootstrap", function () {
          return window.$;
      });

      define("jquery", function () {
          return window.$;
      });

      define("jqueryui", function () {
          return window.$;
      });

      define("jquery-ui", function () {
          return window.$;
      });

      define("codemirror/lib/codemirror", function () {
          return window.CodeMirror;
      });

      define("codemirror/mode/meta", function () {
          return window.CodeMirror;
      });

      define("CodeMirror", function () {
          return window.CodeMirror;
      });

    </script>

    {% block meta %}
    {% endblock %}

</head>

<body class="{% block bodyclasses %}{% endblock %}"
 {% block params %}
  {% if logged_in and token %}
    data-jupyter-api-token="{{token | urlencode}}"
  {% endif %}
 {% endblock params %}
>

<noscript>
    <div id='noscript'>
      Jupyter Notebook requires JavaScript.<br>
      Please enable it to proceed.
  </div>
</noscript>

<div id="header">
  <div id="header-container" class="container">
  <div id="ipython_notebook" class="nav navbar-brand pull-left"><a href="{{default_url}}" title='dashboard'>{% block logo %}<img src='{{static_url("base/images/logo.png") }}' alt='Jupyter Notebook'/>{% endblock %}</a></div>

  {% block header_buttons %}

  {% block login_widget %}

    <span id="login_widget">
      {% if logged_in %}
        <button id="logout" class="btn btn-sm navbar-btn">Logout</button>
      {% elif login_available and not logged_in %}
        <button id="login" class="btn btn-sm navbar-btn">Login</button>
      {% endif %}
    </span>

  {% endblock %}

  {% endblock header_buttons %}

  {% block headercontainer %}
  {% endblock %}
  </div>
  <div class="header-bar"></div>

  {% block header %}
  {% endblock %}
</div>

<div id="site">
{% block site %}
{% endblock %}
</div>

{% block after_site %}
{% endblock %}

{% block script %}
{% endblock %}

</body>

</html>
